<div class="container">
  <form #loginForm="ngForm" (submit)='signup()' class="form-signin">
    <h2 class="form-signin-heading">Please sign in</h2>
    <label for="inputEmail" class="sr-only">Email address</label>
    <input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus email=true
      name="email" [(ngModel)]="signinForm.email" #email="ngModel">
    <!-- 如果这个表单是干净的并且没有被碰过 -->
    <!-- <div [hidden]="name.valid || name.pristine" class="alert alert-danger"> 表单不能为空</div> -->
    <div *ngIf="email.invalid && (email.dirty || email.touched)" class="alert alert-danger">

      <div *ngIf="email.errors.required">
        邮箱是必填的
      </div>
      <div *ngIf="email.errors.email">
        无效的邮箱
      </div>
    </div>


    <label for="inputPassword" class="sr-only">Password</label>
    <input type="password" id="inputPassword" class="form-control" minlength=“6” placeholder="Password" name="password" required
      [(ngModel)]="signinForm.password"
      #password="ngModel">
      <div *ngIf="email.invalid && (email.dirty || email.touched)" class="alert alert-danger">

        <div *ngIf="email.errors.required">
          密码是必填的
        </div>
        <div *ngIf="email.errors.minlength">
          MinLength is 6
        </div>
      </div>




    <button [disabled]="!loginForm.form.valid" class="btn btn-lg btn-primary btn-block" type="submit">Sign In</button>
  </form>
  <p class="info"><a routerLink="/signup">No Acount? Register here</a></p>
</div>
